﻿<head>
    <script src="~/lib/vue/dist/vue.global.js"></script>
    <link href="~/lib/element-plus/dist/index.css" rel="stylesheet" />
    <script src="~/lib/element-plus/dist/index.full.js"></script>
    <script src="~/lib/axios/dist/axios.js"></script>
</head>
<div id="app">

    <form method="post" action="../customiz/customizAction!findAttribute">
        <table width="100%">
            <tr>
                <td>
                    <font color="black">
                        您正在做的业务是：人力资源--客户化设置--人力资源档案管理设置--职称设置
                    </font>
                </td>
            </tr>
            <tr>
                <td align="right">
                </td>
            </tr>
        </table>
        <el-table :data="tableData" :header-cell-style="{background:'#FFDB6F',color:'#606266'}">
            <el-table-column prop="attributeName" label="职称名称"></el-table-column>
            <el-table-column label="删除"  >
                <template #default="scope">
                    <el-button v-on:click="handleEdit(scope.row.pbcId)" type="text">
                        删除
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
    </form>
</div>
<script>
    var { createApp, reactive, ref } = Vue
    var app = createApp({
        setup() {
            let tableData = ref([])

            //查询
            function Fill() {
                axios.get('/GetCPCAttributeKind' )
                    .then(res => {
                        tableData.value = res.data;
                    })
            }
            Fill();
            //删除
            function handleEdit(pbcId) {
                if (confirm("确定要删除吗？")) {
                    axios.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
                    axios.post('/DeleteCPC', { id:pbcId }).then(res => {
                        if (res.data) {
                            Fill();
                        }
                    }).catch(err => {
                        console.log(err);
                    })
                }
            }
            return {
                tableData,
                handleEdit
            }
        }
    })
    app.use(ElementPlus)
    app.mount("#app");
</script>
<style>
    body {
        background-color: #FFFFBB;
        border: 1px solid #FFDB6F;
    }

    el-table {
        background-color: #FFFFBB;
    }
</style>